//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by FernFlower decompiler)
//

package org.springframework.cloud.consul;

import com.ecwid.consul.v1.ConsulClient;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import org.springframework.boot.autoconfigure.condition.AllNestedConditions;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.context.annotation.Conditional;
import org.springframework.context.annotation.ConfigurationCondition.ConfigurationPhase;

@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.TYPE, ElementType.METHOD})
@Conditional({ConditionalOnConsulEnabled.OnConsulEnabledCondition.class})
public @interface ConditionalOnConsulEnabled {
    public static class OnConsulEnabledCondition extends AllNestedConditions {
        OnConsulEnabledCondition() {
            super(ConfigurationPhase.REGISTER_BEAN);
        }

        @ConditionalOnClass({ConsulClient.class})
        static class FoundClass {
            FoundClass() {
            }
        }

        @ConditionalOnProperty(
                name = "striver.registry.type",
                havingValue = "consul",
                matchIfMissing = true
        )
        static class FoundProperty {
            FoundProperty() {
            }
        }
    }
}
